<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title></title>
		<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@2.5/lib/index.css">
		<link rel="stylesheet" href="../css/frienddetail.css">
		<script src="../js/flexble.js"></script>
		<script src="https://cdn.jsdelivr.net/npm/vue@2.6.11"></script>
		<script src="https://cdn.jsdelivr.net/npm/vant@2.5/lib/vant.min.js"></script>
		<script type="text/javascript" src="../sdk/webimSDK3.1.2.js"></script>
		<script type="text/javascript" src="../js/WebIMConfig.js"></script>
		<script type="text/javascript" src="../js/webconn.js"></script>
		<script type="text/javascript" src="../js/localstorage.js"></script>
		<script type="text/javascript" src="../utils/msgtype.js"></script>
		<script type="text/javascript" src="../utils/login.js"></script>
	</head>
	<body>
		<div id="bigbox" class="friendDetailBox">
			<div class="fixedtop">
				<div class="getBack">
					<van-button class="arrowbox" type="default" @click="back">
						<img src="../img/back.png">
					</van-button>
					<van-button class="dingdan" type="default" @click="gourl">
						<img class="oicon1" src="../img/oicon1.png">
					</van-button>
				</div>
			</div>
			<div class="detailbox">
				<img class="avatar" src="../img/avatar.jpg" >
				<p class="name">{{detail.name}}</p>
			</div>
			<van-button class="sendmsg" type="default" @click="gochat">
				<img class="detailsend" src="../img/detailsend.png">
				<span>发消息</span>
			</van-button>
		</div>
	</body>
</html>
<script type="text/javascript">
var webvue = new Vue({
	el: '#bigbox',
	data() {
		return {
			detail:'',
			type:''
		}
	},
	mounted(){
		if(getStorage('pagedata')){
			this.detail = getStorage('pagedata');
			saveStorage('pagedata','')
		}
		console.log(getStorage('chatype'))
		if(getStorage('chatype')){
			this.type = getStorage('chatype');
			console.log(this.type)
			removeStorage('chatype')
		}
	},
	methods:{
		back(){
			window.history.go(-1); 
		},
		gourl(){ 
			saveStorage('pagedata',this.detail)
			if(this.detail.groupid){
				window.location.href = 'groupSet.html'
			}else{
				window.location.href = 'friendSet.html'
			}
		},
		gochat(){
			if(this.type == 'group'){
				saveStorage('chatype','group')
			}
			saveStorage('pagedata',this.detail)
			window.location.href = 'chatpage.html'
		}
	}
})
</script>